package com.wanmait.myhouse.managerController;

import com.wanmait.myhouse.dao.UserDAO;
import com.wanmait.myhouse.vo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("manager")
public class UserByNameController {
    @GetMapping("userByName")
    public String userByName(String userName , Model model){
        UserDAO userDAO = new UserDAO();
        User user = userDAO.userByName(userName);
        model.addAttribute("user",user);
        return "manager/userByname";
    }
}
